﻿namespace Tszy.Unlimited.Base.Infrastructure.Queues.RabbitMQ;

/// <summary>
/// RabbitMQ 配置。
/// </summary>
public class RabbitMQConfig
{
    /// <summary>
    /// RabbitMQ 配置。
    /// </summary>
    /// <param name="exchangeName">交换机名称。</param>
    /// <param name="queueName">队列名称。</param>
    /// <param name="exchangeType">交换机类型。</param>
    /// <param name="autoAck">是否自动应答。</param>
    public RabbitMQConfig(string exchangeName, string queueName,
        string exchangeType = RabbitMQExchangeType.DIRECT, bool autoAck = false)
    {
        ExchangeName = exchangeName ?? string.Empty;
        QueueName = queueName ?? string.Empty;
        ExchangeType = exchangeType ?? string.Empty;
        AutoAck = autoAck;
    }

    /// <summary>
    /// 交换机名称。
    /// </summary>
    public string ExchangeName { get; set; }

    /// <summary>
    /// 交换机类型。
    /// </summary>
    public string ExchangeType { get; set; } = RabbitMQExchangeType.DIRECT;

    /// <summary>
    /// 队列名称。
    /// </summary>
    public string QueueName { get; set; } = string.Empty;

    /// <summary>
    /// 是否自动应答。
    /// </summary>
    public bool AutoAck { get; set; } = false;

    /// <summary>
    /// 是否持久化。
    /// </summary>
    public bool Durable { get; set; } = false;
}